<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>绑定手机号</title>
    <link rel="stylesheet" type="text/css" href="__CSS__/api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/aui.css"/>
    <style>
    	body{
			background-color:#F6F6F6;
    	}
    	.outer{
    		padding-left:18.5px;
    		padding-right:18.5px;
    		height:45px;
    		border-radius: 1px;
    		width:100%;
    	}
    	input[type=tel],
		input[type=password],
		input[type=text] {
			background:#FFFFFF ;
			margin: 0;
			/*color: #fff;*/
			font-size: 14px;
			height:45px;
			padding-left:23.5px;
			border-radius:0.1px;
		}
		input::-webkit-input-placeholder {
		    color:#A3A5A8;
		    font-size: 14px;
		}
		.pwd{
			margin-top:15px;
		}
		 .losePwd{
        	text-align:right;
        	margin-top:9.5px;
        	color:#181F26;
        	font-size:14px;
        }
        .register{
        	height:45px;
        	margin-top:15.5px;
        	color:#FFFFFF;
        	font-size:16px;
        	background: linear-gradient(-127deg,rgba(240,64,64,1),rgba(255,122,122,1));
					border-radius: 4px;
        	text-align:center;
        	line-height:45px;
        }
       	.underLine{
       		height:1px;
       	}
      	.other{
      		color:#191F25;
        	font-size:14px;
        	margin-top:70px;
        	margin-left:17.5px;
        	margin-right:17.5px;
      	}
      	.way1{
      		width:60px;
            height:60px;
            background: url(__IMG__/qq.png) no-repeat center center;
            background-size: 26px 31px;
            margin-top:80px;
            margin-bottom:60px;
      	}
      	.way2{
      		width:60px;
            height:60px;
            background: url(__IMG__/weixin.png) no-repeat center center;
            background-size: 37px 31px;
            margin-top:80px;
            margin-bottom:60px;
      	}
      	.outer1{
      	    margin-top:31px;
      	}
    </style>
	<style>
		.aui-bar-nav{
			background:linear-gradient(-127deg,rgba(240,64,64,1),rgba(255,122,122,1));
			color:#fff;
		}
		.aui-iconfont {
			position: relative;
			font-family: "aui_iconfont" !important;
			font-size: 0.7rem;
			font-style: normal;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale;
			height: 2.4rem;
		}

		.aui-icon-tu{
			height: 2.4rem;
			width: 23.5px;
			background: url('__IMG__/close.png') no-repeat center left;
			background-size: 12.5px 12.5px;
		}

		.aui-iconfont{
			padding-left:10.5px;
		}
	</style>
</head>
<body>
<header class="aui-bar aui-bar-nav underLine" id="header">
	<a class="aui-pull-left" tapmode="active" onclick="register()"> <span class="aui-iconfont left">注册</span> </a>
	<div class="aui-title">绑定</div>
	<a class="aui-pull-right" tapmode="active" onclick="closeWin()">
		<span class="aui-iconfont aui-icon-tu" ></span>
	</a>
</header>
	<div class="outer outer1">
	<input type="tel"  placeholder="请输入您手机号" id="user_name" maxlength="11" />
	</div>

	<div class="outer pwd">
	<input type="password" placeholder="请输入密码" minlength="6" maxlength="20"  id='user_pwd' />
	</div>

	<div class="outer losePwd" onclick="find_pwd()"  tapmode="active">忘记密码</div>

	<div class="outer">
	<div class="register" onclick="toLogin()" tapmode="active">登录</div>
	</div>
</body>
</html>
<script type="text/javascript" src="__JS__/jquery.min.js"></script>
<script type="text/javascript">
    function toLogin() {
        var user_name = $('#user_name').val();
        var user_pwd = $('#user_pwd').val();
        var regBox = {
            regMobile: /^\d{11}$/ //手机
        }

        var regBox1 = {
            regUpwd: /^[\da-zA-Z]{6,20}$/ //密码6-20位英文或数字
        }

        var rPhone = regBox.regMobile.test(user_name);
        var rPwd = regBox1.regUpwd.test(user_pwd)
		if(!rPhone){
            alert('请输入正确手机号')
		}else{
            if(!rPwd){
                alert('请输入6-20位英文或数字')
            }else{
                $.ajax({
                    url: '{:url("Login/userLogin")}',
                    data: 'phone=' + user_name + '&pass=' + user_pwd,//
                    type: 'POST',
                    dataType: 'JSON',
                    success: function (data) {
                        if(data.status != 200){
                            alert(data.msg);
						}else{
                            location.href = '{:url("home/Index/index")}';
						}
                    },
                    error: function () {
                        alert('Ajax error!');
                    }
                })
            }
		}
    }
    function register() {
        location.href = '{:url("home/Login/goZhuce")}';
    }
    function closeWin() {
        location.href = '{:url("home/Index/index")}';
    }
    function find_pwd() {
        location.href = '{:url("home/Login/forget")}';
    }

</script>